var myApp = angular.module('myApp',['ui.router','myRoute','User','Temperature','BloodPressure','ECG']);
//控制angularjs需要的一些全局属性
myApp.run(function($rootScope){
    //alert框初始化，用于自动关闭
    $rootScope.alertInfo = {
        show:false,
    }
});

//前端访问环境配置
//myApp.constant('rootPath','http://localhost:8099')
myApp.constant('rootPath','http://120.24.69.113:8099')
//myApp.constant('rootPath','http://115.28.72.204:8099')


//日期工具
var dateUtils = {

}
//温度提示工具
var bloodPressureUtils = {
    hightPressureLevel:function(data){
        if(data < 90){
            return {showClass:'info',notes:'血压偏低'}
        }else if(data > 140){
            return {showClass:'danger',notes:'血压偏高'}
        }
        return {showClass:'',notes:'正常范围'}
    },
    lowPressureLevel:function(data){
        if(data < 60){
            return {showClass:'info',notes:'血压偏低'}
        }else if(data > 90){
            return {showClass:'danger',notes:'血压偏高'}
        }
        return {showClass:'',notes:'正常范围'}
    },
    pulseLevel:function(data){
        if(data < 60){
            return {showClass:'info',notes:'脉搏次数偏低'}
        }else if(data > 90){
            return {showClass:'danger',notes:'脉搏次数偏高'}
        }
        return {showClass:'',notes:'正常范围'}
    }
}
//温度提示工具
var temperatureUtils = {
    level:function(data){
        if(data < 35.5){
            return {showClass:'info',notes:'温度偏低'};
        }else if(data > 37.4 && data < 38.5){
            return {showClass:'warning',notes:'低热'};
        }else if(data >= 38.5){
            return {showClass:'danger',notes:'高热'};
        }else{
            return {showClass:'',notes:'正常'};
        }
    }
}
//服务器响应状态
var ResponseStatus  = {
    SUCCESS:200,
    USER_CHECK_LOGIN:401,
    REQUEST_PARAMETER_ERROR:402,
    EXCEPTION:500
}


